package com.yixun.qfbao.dao.impl;

import com.yixun.qfbao.dao.ApiFailLogDao;
import com.yixun.qfbao.mapper.ApiFailLogMapper;
import com.yixun.qfbao.model.ApiFailLog;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Calendar;
import java.util.List;

/**
 * @author liuqi
 */
@Service("apiFailLogDao")
public class ApiFailLogDaoImpl implements ApiFailLogDao {

    @Autowired
    private ApiFailLogMapper mapper;


    @Override
    public void addApiFailLog(ApiFailLog apiFailLog) {
        apiFailLog.setCreateTime(Calendar.getInstance().getTime());
        mapper.addApiFailLog(apiFailLog);
    }

    @Override
    public List<ApiFailLog> listApiFailLogBySendM2Again() {
        return mapper.listApiFailLogBySendM2Again();
    }

    @Override
    public int updateApiFailLog(ApiFailLog apiFailLog) {
        apiFailLog.setUpdateTime(Calendar.getInstance().getTime());
        return mapper.updateApiFailLog(apiFailLog);
    }
}
